Description:
MNU detects unused class members as follows:
non-public and non-protected methods that are not called
during program execution. Such methods may be called only by methods that are
also never executed. Unused methods are detected when the option Check methods
is set in the audit's properties.non-public and non-protected fields that are not used by
any method, instance, class, or variable initializer of the declaring class.
Unused fields are detected when the option Check fields is set.Only private members are checked when the option Check private members only is set.
Incorrect:
class Property {
private string name;
public object value;
private object getValue() {
return value;
}
private void print() {
Console.WriteLine(getValue() + " = " + value);
}
}
Correct:
class Property {
public object value;
}